<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <!-- vs插件 
        1.vue3 Snippets
    -->
    <div id="root">
        <h2>今天天气很{{info}}.{{x}}</h2>
        <button @click="isHot = !isHot;x++">切换天气1</button>
        <button @click="changeWeather">切换天气2</button>
        <button @click="window.alert(1)">切换天气3</button>
    </div>

    <script>
        Vue.config.productionTip = false
        new Vue({
            el: '#root',
            data: {
                isHot: true,
                x: 1,
                window
            },
            computed: {
                info () {
                    return this.isHot?'炎热' : '凉爽' 
                }
            },
            methods: {
                changeWeather () {
                    this.isHot = !this.isHot
                    this.x++
                }
            }
        })


    </script>
</body>
</html>